#include"verilated.h"
#include"obj_dir/Vdecode24.h"
#include"stdio.h"
#include"stdlib.h"
#include"assert.h"
#include"verilated_vcd_c.h"

VerilatedContext* contextp = NULL;
VerilatedVcdC* tfp = NULL;

static Vdecode24* top;

void step_and_dump_wave(){
	top->eval();
	contextp->timeInc(1);
	tfp->dump(contextp->time());
}


void sim_init(){
	contextp = new VerilatedContext;
	top = new Vdecode24;
	tfp = new VerilatedVcdC;
	contextp->traceEverOn(true);
	top->trace(tfp,0);
	tfp->open("obj_dir/simx.vcd");
}

void sim_exit(){
step_and_dump_wave();
tfp->close();
}

int main(){

	sim_init();
top->en=0b0;top->x=0b10;step_and_dump_wave();
top->en=0b1;top->x=0b10;step_and_dump_wave();
	sim_exit();
}
